<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%@taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="springform"
	uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="spring"
	uri="http://www.springframework.org/tags"%>
<div id="main">
	<div id="welcome" class="post">
		<h2 class="title">Trova utente</h2>
		<h3 class="date"><span class="month">Mar.</span> <span class="day">8</span><span class="year">, 2007</span></h3>
		<div class="meta">
		<spring:hasBindErrors name="dataNascita">
			<springform:errors ></springform:errors>
		</spring:hasBindErrors>
			<p>
		<form name="cercaUtenteForm" action="searchUtente.do" method="post">
			<fieldset>
			<table>
				<tr>
					<td>Nickname</td>
					<td><input type="text" name="nickname" /></td>
					<td><input type="submit" name="Cerca" value="Cerca" />
				</tr>
				
			</table>
		</form>
			<c:choose>
				<c:when test="${not empty utenti}">
				<form name="lista" method="post" action="profilaUtente.do">
			<table style="border: thin thin thin thin; ">
			<th></th>
			<th>Nickname</th>
			<th>Nome</th>
			<th>Cognome</th>
			<th>Email</th>
			<th>Data nascita</th>
			<th>Sospeso</th>
			<c:forEach items="${utenti}" var="utente" >
			<tr>
				<td>
					<input type="radio" name="nickNameSelected" value="<c:out value="${utente.nickname}"></c:out>"/>
				</td>
				<td>
					<c:out value="${utente.nickname}"></c:out>
				</td>
				<td>
					<c:out value="${utente.nome}"></c:out>
				</td>
				<td>
					<c:out value="${utente.cognome}"></c:out>
				</td>
				<td>
					<c:out value="${utente.email}"></c:out>
				</td>
				<td>
					<fmt:formatDate value="${utente.dataNascita}" pattern="dd/MM/yyyy"/>
				</td>
				<td>
					<c:out value="${utente.sospeso}"></c:out>
				</td>
				
			</tr>
			</c:forEach>
			<tr>
			<td>
				&nbsp;
			</td>
			<td>
				&nbsp;
			</td>
			</tr>
			<tr>
			<td align="center">
				<input type="submit" name="selUtente" value="Crea profilo" style="background: transparent;border: inset thin;"/>
			</td>
			<td align="center">
				<input type="reset" name="Reset" value="Azzera" style="background: transparent;border: inset thin;"/>
			</td>
			</tr>
			</table>
			</form>
			</c:when>
			
			<c:otherwise>Nessun utente trovato</c:otherwise>
			</c:choose>
			</fieldset>
		</form>			
	</p>
		</div>
	</div>
</div>


